home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 2 / Amiga Tools 2.iso / tools / packer / tar / doc / tar.5.man < prev    next >
Text File  |  1995-03-09  |  14KB  |  330 lines

  1.  
  2.  
  3.  
  4.      TTTTAAAARRRR((((5555))))             AAAAmmmmiiiiggggaaaaDDDDOOOOSSSS ((((11115555 OOOOccccttttoooobbbbeeeerrrr 1111999988887777))))              TTTTAAAARRRR((((5555))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           tar - tape (or other media) archive file format
  10.  
  11.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  12.           A ``tar tape'' or file contains a series of records.  Each
  13.           record contains TRECORDSIZE bytes (see below).  Although
  14.           this format may be thought of as being on magnetic tape,
  15.           other media are often used.  Each file archived is
  16.           represented by a header record which describes the file,
  17.           followed by zero or more records which give the contents of
  18.           the file.  At the end of the archive file there may be a
  19.           record filled with binary zeros as an end-of-file indicator.
  20.           A reasonable system should write a record of zeros at the
  21.           end, but must not assume that an end-of-file record exists
  22.           when reading an archive.
  23.  
  24.           The records may be blocked for physical I/O operations.
  25.           Each block of _N records (where _N is set by the ----bbbb option to
  26.           _t_a_r) is written with a single write() operation.  On
  27.           magnetic tapes, the result of such a write is a single tape
  28.           record.  When writing an archive, the last block of records
  29.           should be written at the full size, with records after the
  30.           zero record containing all zeroes.  When reading an archive,
  31.           a reasonable system should properly handle an archive whose
  32.           last block is shorter than the rest, or which contains
  33.           garbage records after a zero record.
  34.  
  35.           The header record is defined in the header file <tar.h> as
  36.           follows:
  37.           /*
  38.            * Standard Archive Format - Standard TAR - USTAR
  39.            */
  40.           #define   RECORDSIZE     512
  41.           #define   NAMSIZ    100
  42.           #define   TUNMLEN   32
  43.           #define   TGNMLEN   32
  44.  
  45.           union record {
  46.                char      charptr[RECORDSIZE];
  47.                struct header {
  48.                     char name[NAMSIZ];
  49.                     char mode[8];
  50.                     char uid[8];
  51.                     char gid[8];
  52.                     char size[12];
  53.                     char mtime[12];
  54.                     char chksum[8];
  55.                     char linkflag;
  56.                     char linkname[NAMSIZ];
  57.                     char magic[8];
  58.                     char uname[TUNMLEN];
  59.                     char gname[TGNMLEN];
  60.  
  61.  
  62.      Page 1                                           (printed 3/8/90)
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.      TTTTAAAARRRR((((5555))))             AAAAmmmmiiiiggggaaaaDDDDOOOOSSSS ((((11115555 OOOOccccttttoooobbbbeeeerrrr 1111999988887777))))              TTTTAAAARRRR((((5555))))
  70.  
  71.  
  72.  
  73.                     char devmajor[8];
  74.                     char devminor[8];
  75.                } header;
  76.           };
  77.  
  78.           /* The checksum field is filled with this while the checksum is computed. */
  79.           #define   CHKBLANKS "        "          /* 8 blanks, no null */
  80.  
  81.           /* The magic field is filled with this if uname and gname are valid. */
  82.           #define   TMAGIC    "ustar  "      /* 7 chars and a null */
  83.  
  84.           /* The linkflag defines the type of file */
  85.           #define   LF_OLDNORMAL '\0'        /* Normal disk file, Unix compatible */
  86.           #define   LF_NORMAL '0'       /* Normal disk file */
  87.           #define   LF_LINK   '1'       /* Link to previously dumped file */
  88.           #define   LF_SYMLINK     '2'       /* Symbolic link */
  89.           #define   LF_CHR    '3'       /* Character special file */
  90.           #define   LF_BLK    '4'       /* Block special file */
  91.           #define   LF_DIR         '5'       /* Directory */
  92.           #define   LF_FIFO   '6'       /* FIFO special file */
  93.           #define   LF_CONTIG '7'       /* Contiguous file */
  94.           /* Further link types may be defined later. */
  95.  
  96.           /* Bits used in the mode field - values in octal */
  97.           #define   TSUID          04000          /* Set UID on execution */
  98.           #define   TSGID          02000          /* Set GID on execution */
  99.           #define   TSVTX          01000          /* Save text (sticky bit) */
  100.  
  101.           /* File permissions */
  102.           #define   TUREAD    00400          /* read by owner */
  103.           #define   TUWRITE   00200          /* write by owner */
  104.           #define   TUEXEC    00100          /* execute/search by owner */
  105.           #define   TGREAD    00040          /* read by group */
  106.           #define   TGWRITE   00020          /* write by group */
  107.           #define   TGEXEC    00010          /* execute/search by group */
  108.           #define   TOREAD    00004          /* read by other */
  109.           #define   TOWRITE   00002          /* write by other */
  110.           #define   TOEXEC    00001          /* execute/search by other */
  111.  
  112.           All characters in header records are represented using 8-bit
  113.           characters in the local variant of ASCII.  Each field within
  114.           the structure is contiguous; that is, there is no padding
  115.           used within the structure.  Each character on the archive
  116.           medium is stored contiguously.
  117.  
  118.           Bytes representing the contents of files (after the header
  119.           record of each file) are not translated in any way and are
  120.           not constrained to represent characters or to be in any
  121.           character set.  The _t_a_r(5) format does not distinguish text
  122.           files from binary files, and no translation of file contents
  123.           should be performed.
  124.  
  125.  
  126.  
  127.  
  128.      Page 2                                           (printed 3/8/90)
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.      TTTTAAAARRRR((((5555))))             AAAAmmmmiiiiggggaaaaDDDDOOOOSSSS ((((11115555 OOOOccccttttoooobbbbeeeerrrr 1111999988887777))))              TTTTAAAARRRR((((5555))))
  136.  
  137.  
  138.  
  139.           The fields _n_a_m_e, _l_i_n_k_n_a_m_e, _m_a_g_i_c, _u_n_a_m_e, and _g_n_a_m_e are
  140.           null-terminated character strings.  All other fields are
  141.           zero-filled octal numbers in ASCII.  Each numeric field (of
  142.           width _w) contains _w-2 digits, a space, and a null, except
  143.           _s_i_z_e and _m_t_i_m_e, which do not contain the trailing null.
  144.  
  145.           The _n_a_m_e field is the pathname of the file, with directory
  146.           names (if any) preceding the file name, separated by
  147.           slashes.
  148.  
  149.           The _m_o_d_e field provides nine bits specifying file
  150.           permissions and three bits to specify the Set UID, Set GID
  151.           and Save Text (TSVTX) modes.  Values for these bits are
  152.           defined above.  When special permissions are required to
  153.           create a file with a given mode, and the user restoring
  154.           files from the archive does not hold such permissions, the
  155.           mode bit(s) specifying those special permissions are
  156.           ignored.  Modes which are not supported by the operating
  157.           system restoring files from the archive will be ignored.
  158.           Unsupported modes should be faked up when creating an
  159.           archive; e.g.  the group permission could be copied from the
  160.           `other' permission.
  161.  
  162.           The _u_i_d and _g_i_d fields are the user and group ID of the file
  163.           owners, respectively.
  164.  
  165.           The _s_i_z_e field is the size of the file in bytes; linked
  166.           files are archived with this field specified as zero.
  167.  
  168.           The _m_t_i_m_e field is the modification time of the file at the
  169.           time it was archived.  It is the ASCII representation of the
  170.           octal value of the last time the file was modified,
  171.           represented as in integer number of seconds since January 1,
  172.           1970, 00:00 Coordinated Universal Time.
  173.  
  174.           The _c_h_k_s_u_m field is the ASCII representaion of the octal
  175.           value of the simple sum of all bytes in the header record.
  176.           Each 8-bit byte in the header is treated as an unsigned
  177.           value.  These values are added to an unsigned integer,
  178.           initialized to zero, the precision of which shall be no less
  179.           than seventeen bits.  When calculating the checksum, the
  180.           _c_h_k_s_u_m field is treated as if it were all blanks.
  181.  
  182.           The _t_y_p_e_f_l_a_g field specifies the type of file archived.  If
  183.           a particular implementation does not recognize or permit the
  184.           specified type, the file will be extracted as if it were a
  185.           regular file.  As this action occurs, _t_a_r issues a warning
  186.           to the standard error.
  187.  
  188.           LF_NORMAL or LF_OLDNORMAL
  189.                represents a regular file.  For backward compatibility,
  190.                a _t_y_p_e_f_l_a_g value of LF_OLDNORMAL should be silently
  191.  
  192.  
  193.  
  194.      Page 3                                           (printed 3/8/90)
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.      TTTTAAAARRRR((((5555))))             AAAAmmmmiiiiggggaaaaDDDDOOOOSSSS ((((11115555 OOOOccccttttoooobbbbeeeerrrr 1111999988887777))))              TTTTAAAARRRR((((5555))))
  202.  
  203.  
  204.  
  205.                recognized as a regular file.  New archives should be
  206.                created using LF_NORMAL.  Also, for backward
  207.                compatability, _t_a_r treats a regular file whose name
  208.                ends with a slash as a directory.
  209.  
  210.           LF_LINK
  211.                represents a file linked to another file, of any type,
  212.                previously archived.  Such files are identified in Unix
  213.                by each file having the same device and inode number.
  214.                The linked-to name is specified in the _l_i_n_k_n_a_m_e field
  215.                with a trailing null.
  216.  
  217.           LF_SYMLINK
  218.                represents a symbolic link to another file.  The
  219.                linked-to name is specified in the _l_i_n_k_n_a_m_e field with
  220.                a trailing null.
  221.  
  222.           LF_CHR or LF_BLK
  223.                represent character special files and block special
  224.                files respectively.  In this case the _d_e_v_m_a_j_o_r and
  225.                _d_e_v_m_i_n_o_r fields will contain the major and minor device
  226.                numbers respectively.  Operating systems may map the
  227.                device specifications to their own local specification,
  228.                or may ignore the entry.
  229.  
  230.           LF_DIR
  231.                specifies a directory or sub-directory.  The directory
  232.                name in the _n_a_m_e field should end with a slash.  On
  233.                systems where disk allocation is performed on a
  234.                directory basis the _s_i_z_e field will contain the maximum
  235.                number of bytes (which may be rounded to the nearest
  236.                disk block allocation unit) which the directory may
  237.                hold.  A _s_i_z_e field of zero indicates no such limiting.
  238.                Systems which do not support limiting in this manner
  239.                should ignore the _s_i_z_e field.
  240.  
  241.           LF_FIFO
  242.                specifies a FIFO special file.  Note that the archiving
  243.                of a FIFO file archives the existence of this file and
  244.                not its contents.
  245.  
  246.           LF_CONTIG
  247.                specifies a contiguous file, which is the same as a
  248.                normal file except that, in operating systems which
  249.                support it, all its space is allocated contiguously on
  250.                the disk.  Operating systems which do not allow
  251.                contiguous allocation should silently treat this type
  252.                as a normal file.
  253.  
  254.           `A' - `Z'
  255.                are reserved for custom implementations.  None are used
  256.                by this version of the _t_a_r program.
  257.  
  258.  
  259.  
  260.      Page 4                                           (printed 3/8/90)
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.      TTTTAAAARRRR((((5555))))             AAAAmmmmiiiiggggaaaaDDDDOOOOSSSS ((((11115555 OOOOccccttttoooobbbbeeeerrrr 1111999988887777))))              TTTTAAAARRRR((((5555))))
  268.  
  269.  
  270.  
  271.           _o_t_h_e_r
  272.                values are reserved for specification in future
  273.                revisions of the P1003 standard, and should not be used
  274.                by any _t_a_r program.
  275.  
  276.           The _m_a_g_i_c field indicates that this archive was output in
  277.           the P1003 archive format.  If this field contains TMAGIC,
  278.           then the _u_n_a_m_e and _g_n_a_m_e fields will contain the ASCII
  279.           representation of the owner and group of the file
  280.           respectively.  If found, the user and group ID represented
  281.           by these names will be used rather than the values contained
  282.           within the _u_i_d and _g_i_d fields.  User names longer than
  283.           TUNMLEN-1 or group names longer than TGNMLEN-1 characters
  284.           will be truncated.
  285.  
  286.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  287.           tar(1), ar(5), cpio(5), dump(8), restor(8), restore(8)
  288.  
  289.      BBBBUUUUGGGGSSSS
  290.           Names or link names longer than NAMSIZ-1 characters cannot
  291.           be archived.
  292.  
  293.           This format does not yet address multi-volume archives.
  294.  
  295.      NNNNOOOOTTTTEEEESSSS
  296.           This manual page was adapted by John Gilmore from Draft 6 of
  297.           the P1003 specification
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.      Page 5                                           (printed 3/8/90)
  327.  
  328.  
  329.  
  330.